<template>
  <div class="container">

    <el-button @click="getAll()"></el-button>
    <zb-form-select-data v-bind="optionData" v-model="baseData.accountArr"  :disabled="editable">
    </zb-form-select-data>
    <zb-form v-bind="optionData1" :model="baseData" ref="aaa"></zb-form>

  </div>
</template>

<script>

  import ZbFormSelectData from "./plugins/myComponents/ZbForm/form-select-data";
  import ZbForm from "./plugins/myComponents/ZbForm/ZbForm";
  export default {
    name: "projectAssessmentDetail",
    components: {ZbForm, ZbFormSelectData},
    data() {
      return {
        editable: false,//是否可编辑
        optionData:{
          label: "项目名称",
          prop: "accountArr",
          type: "selectData",
          searchKey: "name",
          url: `http://testjs.zhengbang.com:5566/zlgServer/common/list`,
          props: {
            label: "nameCn",
            value: "id"
          },
          createdRequest: false,
          searchIconVisible:true,
          filterAble:false,
          multiple:false,
          getDictSuccessStatus:0,
          getDictResultMap:{
            status:'data.code',
            data:'data.data',
            list:'data.data.records',
            total:'data.data.total',
          },
          method:'post',
          params:{
            pageNum:1,
            pageSize:3,
          },
          dialogType:2,
          labelFields:['nameCn','account'],
          labelFieldsName:['名称','账号'],
          searchLabel:['nameCn','account'],
          searchLabelName:['名称','账号'],
          headers:{
            Authorization:'Bearer eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImUyNDNkZGMxLTM4YzktNDc4Ny1iNjE1LWMwM2IzNmM4OWZjYSJ9.G6MFb2CigcNrnuVIyEUja84av43T5vjha3HDHNSEy7HqdjW0zZXGTkCBMfNrJv5GbGMElXssTGudul33H7S7NQ'
          },
          listeners:{
            dataChange:(val)=>{
            },
          }
        },
        optionData1:{
          labelWidth: "160px",
          rules:{
            progress: [
              { required: true, message: '请输入 反馈进度', trigger: 'change' },
              { pattern: /^([1-9]\d?|100)$/, message: '不能为0', trigger: 'blur' }
            ],
            accountObject: [
              { required: true, message: '请输入 反馈说明', trigger: 'change' }
            ],
            fileList: [
              { required: true, message: '请选择 附件', trigger: 'blur' }
            ],
          },
          options:[
            {
              label: "反馈进度(%)",
              prop: "progress",
              type: 'slider',
              height:62,
              max:100,
              min:0,
              span: 24,
              listeners:{
                change:(val)=>{
                }
              }
            },
            // {
            //   label: "项目名称",
            //   prop: "accountObject",
            //   type: "selectDataObject",
            //   searchKey: "name",
            //   url: `http://testjs.zhengbang.com:5566/zlgServer/common/list`,
            //   props: {
            //     label: "nameCn",
            //     value: "id"
            //   },
            //   height:200,
            //   createdRequest: false,
            //   searchIconVisible:true,
            //   filterAble:false,
            //   getDictSuccessStatus:0,
            //   getDictResultMap:{
            //     status:'data.code',
            //     data:'data.data',
            //     list:'data.data.records',
            //     total:'data.data.total',
            //   },
            //   clickClose:true,
            //   method:'post',
            //   params:{
            //     pageNum:1,
            //     pageSize:3,
            //   },
            //   dialogType:2,
            //   labelFields:['nameCn','account'],
            //   labelFieldsName:['名称','账号'],
            //   searchLabel:['nameCn','account'],
            //   searchLabelName:['名称','账号'],
            //   headers:{
            //     Authorization:'Bearer eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImExYzU3MjkxLTZkYmUtNDljOC05ZDA0LWU5Zjk2OWNjMWUwOCJ9.KJ84Ez3G6kSFNMIJajnxZ4APEe0ZyG7sQarmVsQvC08l7EauPJOvp-tg7J92ZlTIm4-_v5D_jqITghBr3FfLVw'
            //   },
            //   listeners:{
            //     dataChange:(val)=>{
            //     },
            //   }
            // },
            {
              label: "项目名称",
              prop: "accountArr.asd",
              labelText: "nameCnArr",
              type: "selectData",
              searchKey: "name",
              url: `http://testjs.zhengbang.com:5566/zlgServer/common/list`,
              props: {
                label: "nameCn",
                value: "id"
              },
              createdRequest: false,
              searchIconVisible:true,
              filterAble:false,
              getDictSuccessStatus:0,
              getDictResultMap:{
                status:'data.code',
                data:'data.data',
                list:'data.data.records',
                total:'data.data.total',
              },
              clickClose:true,
              method:'post',
              params:{
                pageNum:1,
                pageSize:3,
              },
              dialogType:2,
              labelFields:['nameCn','account'],
              labelFieldsName:['名称','账号'],
              searchLabel:['nameCn','account'],
              searchLabelName:['名称','账号'],
              headers:{
                Authorization:'Bearer eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImExYzU3MjkxLTZkYmUtNDljOC05ZDA0LWU5Zjk2OWNjMWUwOCJ9.KJ84Ez3G6kSFNMIJajnxZ4APEe0ZyG7sQarmVsQvC08l7EauPJOvp-tg7J92ZlTIm4-_v5D_jqITghBr3FfLVw'
              },
              listeners:{
                dataChange:(val)=>{
                },
              }
            }
          ]
        },
        baseData: {
          progress:null,
          accountArr:{asd:'a'},
          nameCnArr:['晏雪林','胡康华管理员','超级管理员'],
          accountObject:[
            {id:'3',nameCn:'晏雪林'},
            {id:'350e11a4218a4df6806539d7352826af',nameCn:'胡康华管理员'},
            {id:'1',nameCn:'超级管理员'}
          ],
        },
      }
    },

    created() {
    },
    methods:{
      getAll(){
        this.$refs.aaa.validate(validate=>{
          if (validate){

          }else{
            return false
          }
        })
        console.log(this.baseData)
      }
    }
  }
</script>

<style scoped lang="scss">
</style>
